package com.example.beatbox.model

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable

class SoundViewModel(private val mBeatBox: BeatBox) : BaseObservable() {
    var sound: Sound? = null
        set(sound) {
            field = sound
            notifyChange()
        }

    val title: String?
        @Bindable
        get() = sound!!.name

    fun onButtonClicked() {
        mBeatBox.play(sound!!)
    }
}